{% load rights_simple_tag %}
<style>
    .pageFormContent div input{
        width: 200px;
    }
    .pageFormContent div{
        float: left;
    }
    .pageFormContent{
        padding: 20px 30px 0 30px;
    }
    .pageFormContent label{
        width: 60px;
        text-align: right;
    }

</style>
<div class="pageContent">
	<form method="post" action="{% url 'rights_management' %}update/{{ o_id }}/" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
        {% csrf_token %}
		<div class="pageFormContent" layoutH="56">

            <div style="margin-bottom: 10px;">
                <label class="">权限名称: </label>
				<input name="name" class="required" type="text" placeholder="请输入权限名称" value="{{ rights.name }}" />
			</div>

            <div style="margin-bottom: 10px;">
                <label>相对url: </label>
				<input name="url" class="required" type="text" placeholder="请输入权限相对url" value="{{ rights.url }}" />
			</div>

            <div style="width: 100%; margin-bottom: 10px;">
                <label>启用状态: </label>
                <select class="combox" name="status">
                    <option value="0" {% if rights.status == "0" %}selected{% endif %}>不启用</option>
                    <option value="1" {% if rights.status == "1" %}selected{% endif %}>启用</option>
                </select>
			</div>

            <div style="width: 100%; margin-bottom: 10px;">
                <label>上级权限: </label>
                <select class="combox" name="p_id">
                    <option value="">请选择</option>
                    {% for i in rights_list %}
                        <option value="{% get_id i %}" {% is_pid i rights.p_id %}>{{ i.name }}</option>
                    {% endfor %}
                </select>
			</div>

		</div>
		<div class="formBar">
			<ul>
				<!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>-->
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>


